package com.coollang.smartbra.activity;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.coollang.smartbra.MyAutoLayoutActivity;
import com.coollang.smartbra.R;
import com.coollang.smartbra.adapter.RedEnvelopesAdapter;
import com.coollang.smartbra.utils.TranslucentSystemBarUtils;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 红包页面
 */
public class RedEnvelopesActivity extends MyAutoLayoutActivity {

    @BindView(R.id.iv_back)
    ImageView mIvBack;

    @BindView(R.id.status_bar)
    View statusBar;

    @BindView(R.id.content)
    LinearLayout content;
    @BindView(R.id.red_recyclerview)
    RecyclerView mRecycleView;

    @Override
    protected void initView() {
        setContentView(R.layout.activity_red_envelopes);
        ButterKnife.bind(this);
        TranslucentSystemBarUtils.showChenJinZhuangTaiLan(statusBar, this, content);
        initViews();
    }

    private void initViews() {
        mIvBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                goBack();

            }
        });
    }

    @Override
    protected void initData() {
        RedEnvelopesAdapter redEnvelopesAdapter = new RedEnvelopesAdapter(this);
        mRecycleView.setAdapter(redEnvelopesAdapter);
        mRecycleView.setLayoutManager(new LinearLayoutManager(this));
    }

    private void goBack() {
        finish();
    }

}
